@extends('layout.home.master')
@section('content')
    <div class="container mt-4">
        <div class="row">
            <div class="col-md-3">
                <div class="card">
                    <div class="card-header text-center">
                        <div> {{$user->name}}</div>
                    </div>
                    <div class="card-body text-center">
                        <div class="avatar avatar-xl">
                            <img src="{{$user->icon}}" alt="..." class="avatar-img rounded-circle">
                        </div>
                        <div class="nav mt-4  nav-pills  " id="v-pills-tab" role="tablist" aria-orientation="vertical">
                            <div class="text-center container">
                            <span  class="badge center-block badge-soft-info ">粉丝：{{$user->fans()->count()}} </span>
                            <span  class="badge center-block badge-soft-warning ml-2">关注：{{$user->follower()->count()}}</span>
                        </div>
                    </div>
                        <div class="container  mt-4">
                            @can('isSub',$user)
                            @if(auth()->user()->isfollower($user))
                            <a href="{{route('info.ToggleFollower',$user)}}" class="btn btn-warning btn-block"></span>取消关注</a>
                             @else
                                <a href="{{route('info.ToggleFollower',$user)}}" class="btn btn-white btn-block"><span class="fe fe-plus "></span>关注</a>
                            @endif
                            @endcan

                        </div>
                </div>
                </div>
            </div>
            <div class="col-md-9">
                <div class="container-fluid">
                    <div class="row">
                        <div class="col-12 ">
                            <!-- Card -->
                            <div class="card">
                                <div class="card-body">

                                    <h3 class="card-title text-center mb-3">
                                        <a href="javascript:;">最新动态</a>
                                    </h3>
                                    <hr>

                                    <div class="row align-items-center">
                                        <div class="col">

                                            <!-- Time -->
                                            <p class="card-text small text-muted">
                                                <i class="fe fe-clock"></i> Updated 2hr ago
                                            </p>

                                        </div>
                                        <div class="col-auto">

                                            <!-- Avatar group -->
                                            <div class="avatar-group">
                                                <a href="profile-posts.html" class="avatar avatar-xs" data-toggle="tooltip" title="" data-original-title="Ab Hadley">
                                                    <img src="{{asset('org/Dashkit')}}/img/avatars/profiles/avatar-2.jpg" class="avatar-img rounded-circle border border-white" alt="...">
                                                </a>
                                                <a href="profile-posts.html" class="avatar avatar-xs" data-toggle="tooltip" title="" data-original-title="Adolfo Hess">
                                                    <img src="{{asset('org/Dashkit')}}/img/avatars/profiles/avatar-3.jpg" class="avatar-img rounded-circle border border-white" alt="...">
                                                </a>
                                                <a href="profile-posts.html" class="avatar avatar-xs" data-toggle="tooltip" title="" data-original-title="Daniela Dewitt">
                                                    <img src="{{asset('org/Dashkit')}}/img/avatars/profiles/avatar-4.jpg" class="avatar-img rounded-circle border border-white" alt="...">
                                                </a>
                                                <a href="profile-posts.html" class="avatar avatar-xs" data-toggle="tooltip" title="" data-original-title="Miyah Myles">
                                                    <img src="{{asset('org/Dashkit')}}/img/avatars/profiles/avatar-5.jpg" class="avatar-img rounded-circle border border-white" alt="...">
                                                </a>
                                                <div class="avatar avatar-xs">
                                                    <div class="avatar-title rounded-circle border border-white">+7</div>
                                                </div>
                                            </div>

                                        </div>
                                    </div> <!-- / .row -->

                                </div> <!-- / .card-body -->
                            </div>

                        </div>
                        <div class="col-12 col-lg-6">
                            <!-- Card -->
                            <div class="card">
                                <div class="card-body">
                                    <h3 class="card-title text-center mb-3">
                                        <a href="team-overview.html">Ta的粉丝</a>
                                    </h3>
                                    <hr>
                                    <div class="row align-items-center">
                                        <div class="col">
                                            <div class="container text-center">
                                                @foreach($user->fans as $fan)
                                                    <a href="{{route('info.user.show',$fan->id)}}">
                                                    <img  src="{{$fan->icon}}" alt="..." class="avatar-img rounded-circle avatar-sm mr-2 mt-2">
                                                    </a>
                                                @endforeach
                                            </div>
                                            <!-- Time -->
                                            <p class="card-text small text-muted">
                                            </p>
                                        </div>

                                    </div> <!-- / .row -->

                                </div> <!-- / .card-body -->
                            </div>
                        </div>
                        <div class="col-12 col-lg-6">
                            <!-- Card -->
                            <div class="card">
                                <div class="card-body">
                                    <h3 class="card-title text-center mb-3">
                                        <a href="team-overview.html">Ta的关注</a>
                                    </h3>
                                    <hr>
                                    <div class="row align-items-center">
                                        <div class="col">
                                            <div class="container text-center">
                                                @foreach($user->follower as $follower)
                                                    <a href="{{route('info.user.show',$follower->id)}}">
                                                        <img  src="{{$follower->icon}}" alt="..." class="avatar-img rounded-circle avatar-sm mr-2 mt-2">

                                                    </a>

                                                @endforeach
                                            </div>
                                            <!-- Time -->
                                            <p class="card-text small text-muted">
                                            </p>
                                        </div>

                                    </div> <!-- / .row -->

                                </div> <!-- / .card-body -->
                            </div>
                        </div>
                        <div class="col-12 col-lg-6">
                            <!-- Card -->
                            <div class="card">
                                <div class="card-body">
                                    <h3 class="card-title text-center mb-3">
                                        <a href="team-overview.html">Ta的收藏</a>
                                    </h3>
                                    <hr>
                                    <div class="row align-items-center">
                                        <div class="col">
                                            <div class="container text-center">
                                                @foreach($user->favorite as $favorites)
                                               <div> <span class="text-muted" style="font-size:13px">{{$favorites->belongsModel->created_at}}</span><a href="" class="" style="font-size: 13px">收藏了{{$favorites->belongsModel->title}}</a></div>
                                                @endforeach
                                            </div>
                                            <!-- Time -->
                                            <p class="card-text small text-muted">
                                            </p>
                                        </div>

                                    </div> <!-- / .row -->

                                </div> <!-- / .card-body -->
                            </div>
                        </div>


                    </div> <!-- / .row -->
                </div>

            </div>
        </div>
    </div>


@endsection
